package com.book.oauth.server.route.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.route.dto.RouteDto;
import com.book.oauth.server.route.vo.RouteVo;
import com.book.oauth.server.route.hystrix.IRouteHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：路由信息 HystrixImpl
 * @Author： leo
 * @CreateDate： 2020-12-31
 * @Email： leo.xiong@suyun360.com
 * Version: 1.0
 */
@Slf4j
@Component
public class RouteHystrixImpl extends BaseHystrixImpl<RouteDto, RouteVo> implements FallbackFactory<IRouteHystrix>, IRouteHystrix {

    @Override
    public IRouteHystrix create(Throwable e) {
        log.error("oauth-server.RouteHystrixImpl.路由信息服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new RouteHystrixImpl();
    }
}
